package chapter08

/**
 *
 * @author cdhuangchao3
 * @date 2023/6/11 5:13 PM
 */
object Test05_MatchCaseClass {
  def main(args: Array[String]): Unit = {
    val student = Student1("zs", 18)

    // 针对对象实例内容进行匹配
    val result: String = student match {
      case Student1("zs", 18) => "zs, 18"
      case _ => "Else"
    }
    println(result)
  }
}

// 定义样例类
case class Student1(name: String, age: Int)
